package com.halflife.shiro.filter;

import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * Created by zhaoyf on 2018/2/25.
 */
//@Component
//@ServletComponentScan
//@WebFilter(urlPatterns = "/login/*",filterName = "loginFilter")
public class CommonFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println(1);
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println(2);
    }

    @Override
    public void destroy() {
        System.out.println(4);

    }
}
